﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExtAspNet;
using System.Text;

namespace HY.WEB.function
{
    public partial class getuser : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BLL.HR.sys_user u = new BLL.HR.sys_user();
                DataTable du=u.GetAllList().Tables[0];
                Grid1.DataSource = du;
                Grid1.DataBind();
            }

        }

        protected void btback_Click(object sender, EventArgs e)
        {
            StringBuilder sv = new StringBuilder();
            StringBuilder sb = new StringBuilder();
            foreach (int row in Grid1.SelectedRowIndexArray)
            {
                sb.Append(Grid1.DataKeys[row][1].ToString());
                sb.Append(",");
                sv.Append(Grid1.DataKeys[row][0].ToString());
                sv.Append(",");
            }

         //   Alert.ShowInTop("你选择了删除项：" + sb.ToString().TrimEnd(','));
         //   HY.BLL.oa.ad.DeleteList(sb.ToString().TrimEnd(','));


            hiduser.Text = sb.ToString().TrimEnd(',');
            hidval.Text = sv.ToString().TrimEnd(',');

            //Alert.Show("添加完成 ");
            PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(hiduser.Text,hidval.Text) +
            ActiveWindow.GetHidePostBackReference());      
        }
    }
}